﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace TienTeTuong
{
    public partial class CategoryDetail : System.Web.UI.Page
    {
      //  public List<CategoryDTO> lstCate = new List<CategoryDTO>();
        public List<CategoryDetailDTO> lstCateDetail = new List<CategoryDetailDTO>();
        public List<CategoryDetailDTO> lstHotCateDetail = new List<CategoryDetailDTO>();
        CategoryDetailBUS cateDetailBUS = new CategoryDetailBUS();
        CategoryBUS cateBUS = new CategoryBUS();
        public int maxPerline;
        public int maxPerLineHot;
        public string cateID;
        public string cateName;
        // declare variable paging
        public int iTotalPage;
        public int iCurPage;
        public int iUpperPage;
        public int iLowerPage;
        public int iTotalResult;
        private int page;
        //CategoryBUS cateBUS = new CategoryBUS();
        protected void Page_Load(object sender, EventArgs e)
        {
            cateID = Request.QueryString["CateID"];
            string strPage = Request.QueryString["page"];
            page = Common.IsNumber(strPage) ? int.Parse(strPage) : 1;

            // chua kiem tra CateID hop len ko
           // var cateDetailBUS = new CategoryDetailBUS();

            cateName = cateBUS.GetCateNameByID(cateID);

            lstCateDetail = cateDetailBUS.GetListCategoryByPage(cateID, page, Common.iNumItemPerPage,out iTotalPage,
                                                                out iCurPage,out iLowerPage,out iUpperPage,out iTotalResult);

            lstHotCateDetail = cateDetailBUS.GetHotListCategoryDetail();
        }
    }
}